home *** CD-ROM | disk | FTP | other *** search
Modula Definition | 1990-06-14 | 5.2 KB | 103 lines | [TEXT/PMED] |
- DEFINITION MODULE TextEdit; (* Christoph Fleischer 07.02.85 *)
- (* MacIntosh Toolbox Text Editor Routines *)
- (* last modification 22.04.85 *)
-
- FROM SYSTEM IMPORT ADDRESS,ADR;
- IMPORT MacBase;
- FROM QuickDraw IMPORT GrafPtr,Style,Point,Rect;
-
- EXPORT QUALIFIED
- teJustLeft,teJustRight,teJustCenter,
- TERec,TEPtr,TEHandle,CharsHandle,CharsPtr,Chars,
- TEActivate,TECalText,TEClick,TECopy,TECut,TEDeActivate,
- TEDelete,TEDispose,TEIdle,TEInit,TEKey,TENew,TEPaste,
- TEScroll,TESetSelect,TESetText,TEInsert,TEUpdate,
- TESetJust,TEGetText,TextBox;
-
- CONST teJustLeft = 0; teJustRight = -1; teJustCenter = 1;
-
- TYPE
- LongInt = MacBase.LongInt;
- Handle = MacBase.Handle;
- Ptr = ADDRESS;
-
- TEHandle = POINTER TO TEPtr;
- TEPtr = POINTER TO TERec;
- TERec = RECORD
- destRect: Rect; (*Destination rectangle*)
- viewRect: Rect; (*view rectangle*)
- selRect: Rect; (*Select rectangle*)
- lineHeight: INTEGER; (*Current font lineheight*)
- firstBL: INTEGER; (*Current first base line offset*)
- selPoint: Point; (*Selection point(mouseLoc)*)
-
- selStart: INTEGER; (*Selection start*)
- selEnd: INTEGER; (*Selection end*)
-
- active: INTEGER; (*<>0 if active*)
-
- workBreak: LongInt; (*Word break routine*)
- clikLoop: LongInt; (*Click loop routine*)
-
- clickTime: LongInt; (*Time of first click*)
- clickLoc: INTEGER; (*Char. location of click*)
-
- caretTime: LongInt; (*Time for next caret blink*)
- caretState: INTEGER; (*On/active booleans*)
-
- just: INTEGER; (*fill style*)
-
- TElength: INTEGER; (*Length of text below*)
- hText: Handle; (*Handle to actual text*)
-
- recalBack: INTEGER; (*<>0 if recal in background*)
- recalLines: INTEGER; (*Line being recal'ed*)
- clikStuff: INTEGER; (*click stuff (internal)*)
-
- crOnly: INTEGER; (*Set to -1 if CR line breaks only*)
-
- txFont: INTEGER; (*Text Font*)
- txFace: Style; (*Text Face*)
- txMode: INTEGER; (*Text Mode*)
- txSize: INTEGER; (*Text Size*)
-
- inPort: GrafPtr; (*Grafport*)
-
- highHook: Ptr; (*Highlighting hook*)
- caretHook: Ptr; (*Highlighting hook*)
-
- nLines: INTEGER; (*Number of lines*)
- lineStarts: ARRAY [0..16000] OF INTEGER; (*Actual line starts themselves*)
- END; (*RECORD*)
-
- CharsHandle = POINTER TO CharsPtr;
- CharsPtr = POINTER TO Chars;
- Chars = ARRAY[0..32000] OF CHAR;
-
-
- PROCEDURE TEActivate( h: TEHandle ); (*INLINE $A9D8*)
- PROCEDURE TECalText( h: TEHandle ); (*INLINE $A9D0*)
- PROCEDURE TEClick( pt: Point; extend: BOOLEAN; h: TEHandle ); (*INLINE $A9D4*)
- PROCEDURE TECopy( h: TEHandle ); (*INLINE $A9D5*)
- PROCEDURE TECut( h: TEHandle ); (*INLINE $A9D6*)
- PROCEDURE TEDeActivate( h: TEHandle ); (*INLINE $A9D9*)
- PROCEDURE TEDelete( h: TEHandle ); (*INLINE $A9D7*)
- PROCEDURE TEDispose( h: TEHandle ); (*INLINE $A9CD*)
- PROCEDURE TEIdle( h: TEHandle ); (*INLINE $A9DA*)
- PROCEDURE TEInit; (*INLINE $A9CC*)
- PROCEDURE TEKey( key: CHAR; h: TEHandle ); (*INLINE $A9DC*)
- PROCEDURE TENew(VAR dest, view: Rect ): TEHandle; (*INLINE $A9D2*)
- PROCEDURE TEPaste( h: TEHandle ); (*INLINE $A9DB*)
- PROCEDURE TEScroll( dh, dv: INTEGER; h: TEHandle ); (*INLINE $A9DD*)
- PROCEDURE TESetSelect( selStart, selEnd: LongInt; h: TEHandle ); (*INLINE $A9D1*)
- PROCEDURE TESetText( inText: Ptr; textLength: LongInt; h: TEHandle );(*INLINE $A9CF*)
- PROCEDURE TEInsert( inText: Ptr; textLength: LongInt; h: TEHandle ); (*INLINE $A9DE*)
- PROCEDURE TEUpdate(VAR rUpdate: Rect; h: TEHandle ); (*INLINE $A9D3*)
- PROCEDURE TESetJust( just: INTEGER; h: TEHandle ); (*INLINE $A9DF*)
- PROCEDURE TEGetText( h: TEHandle ): CharsHandle; (*INLINE $A9CB*)
-
- (*Box drawing utility*)
- PROCEDURE TextBox( inText: Ptr; textLength: LongInt;VAR r: Rect; style: INTEGER );(*INLINE $A9CE*)
-
- END TextEdit.
-